(global-set-key [(f1)] 'manual-entry)

(global-set-key [(f2)] 'shell)

(global-set-key [(f3)] 'query-replace-regexp)
(global-set-key [(control f3)] 'replace-regexp)

(global-set-key [(control f4)] 'bm-toggle)
(global-set-key [(f4)] 'bm-next)
(global-set-key [(shift f4)] 'bm-previous)

(global-set-key [(control f5)] 'gud-run)
(global-set-key [(f5)] 'gud-cont)
(global-set-key [(shift f5)] 'gud)

(global-set-key [(f7)] 'compile)

(global-set-key [(f8)] 'next-error)
(global-set-key [(shift f8)] 'previous-error)

(global-set-key [(f9)] 'gud-break)
(global-set-key [(shift f9)] 'gud-remove)

(global-set-key [(f10)] 'gud-next)

(global-set-key [(f11)] 'gud-step)
(global-set-key [(shift f11)] 'gud-finish)

(global-set-key [(control up)] 'gud-up)
(global-set-key [(control down)] 'gud-down)

(global-set-key [(f12)] 'ecb-toggle-layout)
(global-set-key [(control f12)] 
                (lambda ()
                  (interactive)
                  (if (boundp 'ecb-minor-mode)
                      (if ecb-minor-mode
                       (ecb-deactivate)
                       (ecb-activate))
                    (ecb-activate))))

(global-set-key "\C-c\C-c" 'comment-region)
(global-set-key "\C-xk" 'kill-this-buffer)

(global-set-key [(meta g)] 'goto-line)
(global-set-key [(meta down)] 'move-line-down)
(global-set-key [(meta up)] 'move-line-up)
(global-set-key [(meta /)] 'hippie-expand)

(global-set-key [(mouse-1)] 'mouse-set-point)
(global-set-key [(down-mouse-1)] 'mouse-drag-region)

(global-set-key [(%)] 'match-paren)

(global-set-key [(control o)] 'open-next-line)
(global-set-key [(control s)] 'isearch-forward-regexp)
(global-set-key [(control r)] 'isearch-backward-regexp)

(global-set-key [(control tab)] 'other-window)
;; (global-set-key [(control left)] 'tabbar-backward)
;; (global-set-key [(control right)] 'tabbar-forward)
;; ; meta+up used to backward-word
;; (global-set-key [(meta left)] 'tabbar-backward-group)
;; ; meta+right used to forward-word
;; (global-set-key [(meta right)] 'tabbar-forward-group)

